{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}C:\Users\williamslaro\Documents\Research\Projects\Compression\Fall 2017\Final Version\Replication\Compression--Replication.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res} 6 Mar 2018, 14:06:49

{com}. do "C:\Users\WILLIA~1\AppData\Local\Temp\STD0k000000.tmp"
{txt}
{com}. *****************************************************************
. *** Do file to replicate the analyses for the three illustrations in Laron K Williams, "Compression, Temporal Dependence, and the Sensitivity of Quantities of Interest"
. ***
. *** Created: 7-29-14
. *** Modified: 3-6-18
. ***
. *****************************************************************
. 
. *** Set up the working directory
. *cd ""
. 
. *****************************************************************
. *** Ways and Weeks (2014, AJPS)
. *****************************************************************
. use "Way and Weeks 2014\WayWeeksAJPS.dta", clear
{txt}
{com}. 
. *** Table 1 (page 714)
. btscs pursueonly year ccode, g(time)
{txt}
{com}. gen time2=time*time
{txt}(523 missing values generated)

{com}. gen time3=time2*time
{txt}(523 missing values generated)

{com}. 
. *** Linear probability model
. xtreg pursueonly persdumjlw_lag land gdppercap time time2 time3, re
{res}
{txt}Random-effects GLS regression                   Number of obs     = {res}     5,221
{txt}Group variable: {res}ccode                           {txt}Number of groups  = {res}       173

{txt}R-sq:                                           Obs per group:
     within  = {res}0.2100                                         {txt}min = {res}         1
{txt}     between = {res}0.2404                                         {txt}avg = {res}      30.2
{txt}     overall = {res}0.2309                                         {txt}max = {res}        55

                                                {txt}Wald chi2({res}6{txt})      =  {res}  1376.78
{txt}corr(u_i, X)   = {res}0{txt} (assumed)                    Prob > chi2       =     {res}0.0000

{txt}{hline 15}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}    pursueonly{col 16}{c |}      Coef.{col 28}   Std. Err.{col 40}      z{col 48}   P>|z|{col 56}     [95% Con{col 69}f. Interval]
{hline 15}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
persdumjlw_lag {c |}{col 16}{res}{space 2} .0420842{col 28}{space 2} .0067704{col 39}{space 1}    6.22{col 48}{space 3}0.000{col 56}{space 4} .0288146{col 69}{space 3} .0553539
{txt}{space 10}land {c |}{col 16}{res}{space 2} .0365478{col 28}{space 2} .0029431{col 39}{space 1}   12.42{col 48}{space 3}0.000{col 56}{space 4} .0307795{col 69}{space 3} .0423161
{txt}{space 5}gdppercap {c |}{col 16}{res}{space 2} .0377201{col 28}{space 2} .0052541{col 39}{space 1}    7.18{col 48}{space 3}0.000{col 56}{space 4} .0274223{col 69}{space 3}  .048018
{txt}{space 10}time {c |}{col 16}{res}{space 2}-.0356742{col 28}{space 2} .0010769{col 39}{space 1}  -33.13{col 48}{space 3}0.000{col 56}{space 4}-.0377849{col 69}{space 3}-.0335634
{txt}{space 9}time2 {c |}{col 16}{res}{space 2} .0013545{col 28}{space 2} .0000485{col 39}{space 1}   27.95{col 48}{space 3}0.000{col 56}{space 4} .0012596{col 69}{space 3} .0014495
{txt}{space 9}time3 {c |}{col 16}{res}{space 2} -.000015{col 28}{space 2} 6.14e-07{col 39}{space 1}  -24.47{col 48}{space 3}0.000{col 56}{space 4}-.0000162{col 69}{space 3}-.0000138
{txt}{space 9}_cons {c |}{col 16}{res}{space 2}-.1849437{col 28}{space 2} .0440453{col 39}{space 1}   -4.20{col 48}{space 3}0.000{col 56}{space 4} -.271271{col 69}{space 3}-.0986164
{txt}{hline 15}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
       sigma_u {c |} {res} .12366888
       {txt}sigma_e {c |} {res} .12887359
           {txt}rho {c |} {res}  .4793995{txt}   (fraction of variance due to u_i)
{hline 15}{c BT}{hline 64}

{com}. di _b[persdumjlw_lag]   
{res}.04208425
{txt}
{com}. 
. *** Logit model
. xtlogit pursueonly persdumjlw_lag land gdppercap time time2 time3, nolog

{txt}Random-effects logistic regression{col 49}Number of obs{col 67}={col 69}{res}     5,221
{txt}Group variable: {res}ccode{col 49}{txt}Number of groups{col 67}={col 69}{res}       173

{txt}Random effects u_i ~ {res}Gaussian{txt}{col 49}Obs per group:
{col 63}min{col 67}={col 69}{res}         1
{txt}{col 63}avg{col 67}={col 69}{res}      30.2
{txt}{col 63}max{col 67}={col 69}{res}        55

{txt}Integration method: {res}mvaghermite{txt}{col 49}Integration pts.{col 67}={col 70}{res}       12

{txt}{col 49}Wald chi2({res}6{txt}){col 67}={col 70}{res}   148.57
{txt}Log likelihood  = {res}-194.50376{col 49}{txt}Prob > chi2{col 67}={res}{col 73}0.0000

{txt}{hline 15}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}    pursueonly{col 16}{c |}      Coef.{col 28}   Std. Err.{col 40}      z{col 48}   P>|z|{col 56}     [95% Con{col 69}f. Interval]
{hline 15}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
persdumjlw_lag {c |}{col 16}{res}{space 2} 3.057841{col 28}{space 2} .7008275{col 39}{space 1}    4.36{col 48}{space 3}0.000{col 56}{space 4} 1.684244{col 69}{space 3} 4.431437
{txt}{space 10}land {c |}{col 16}{res}{space 2} .7720593{col 28}{space 2} .1918422{col 39}{space 1}    4.02{col 48}{space 3}0.000{col 56}{space 4} .3960554{col 69}{space 3} 1.148063
{txt}{space 5}gdppercap {c |}{col 16}{res}{space 2} .8052422{col 28}{space 2} .3708129{col 39}{space 1}    2.17{col 48}{space 3}0.030{col 56}{space 4} .0784623{col 69}{space 3} 1.532022
{txt}{space 10}time {c |}{col 16}{res}{space 2}-1.165391{col 28}{space 2} .1168689{col 39}{space 1}   -9.97{col 48}{space 3}0.000{col 56}{space 4} -1.39445{col 69}{space 3} -.936332
{txt}{space 9}time2 {c |}{col 16}{res}{space 2} .0521927{col 28}{space 2} .0067068{col 39}{space 1}    7.78{col 48}{space 3}0.000{col 56}{space 4} .0390476{col 69}{space 3} .0653378
{txt}{space 9}time3 {c |}{col 16}{res}{space 2}-.0006192{col 28}{space 2} .0001006{col 39}{space 1}   -6.15{col 48}{space 3}0.000{col 56}{space 4}-.0008164{col 69}{space 3}-.0004219
{txt}{space 9}_cons {c |}{col 16}{res}{space 2}-16.36276{col 28}{space 2} 3.540838{col 39}{space 1}   -4.62{col 48}{space 3}0.000{col 56}{space 4}-23.30267{col 69}{space 3}-9.422844
{txt}{hline 15}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
      /lnsig2u {c |}{col 16}{res}{space 2} 3.109899{col 28}{space 2} .2384684{col 56}{space 4}  2.64251{col 69}{space 3} 3.577288
{txt}{hline 15}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
       sigma_u {c |}{col 16}{res}{space 2} 4.734847{col 28}{space 2} .5645557{col 56}{space 4} 3.748122{col 69}{space 3} 5.981338
{txt}           rho {c |}{col 16}{res}{space 2} .8720326{col 28}{space 2} .0266111{col 56}{space 4} .8102541{col 69}{space 3} .9157875
{txt}{hline 15}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{txt}LR test of rho=0: {help j_chibar##|_new:chibar2(01) = }{res}139.51{col 56}{txt}Prob >= chibar2 = {res}0.000
{txt}
{com}. keep if e(sample)
{txt}(3,558 observations deleted)

{com}. 
. *** Predict
. predict base, pr
{res}{txt}(using 12 quadrature points)

{com}. 
. tempvar pr_0 pr_1 
{txt}
{com}. replace persdumjlw_lag = 0
{txt}(1,103 real changes made)

{com}. predict `pr_0', pu0
{txt}
{com}. 
. replace persdumjlw_lag = 1
{txt}(5,221 real changes made)

{com}. predict `pr_1', pu0
{txt}
{com}. gen pe = `pr_1' - `pr_0'
{txt}
{com}. 
. qui sum pe
{txt}
{com}. local ape = round(r(mean), 0.001)
{txt}
{com}. local sdpe = round(r(sd), 0.001)
{txt}
{com}. 
. di "Average partial effect = " `ape'
{res}Average partial effect = .007
{txt}
{com}. di "Standard deviation of partial effect = " `sdpe'
{res}Standard deviation of partial effect = .043
{txt}
{com}. 
. sum base `pr_0' `pr_1' pe

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}base {c |}{res}      5,221    .0260464    .0525308   .0001239    .682111
{txt}{space 4}__000000 {c |}{res}      5,221    .0006444    .0073789   8.01e-09   .3370393
{txt}{space 4}__000001 {c |}{res}      5,221     .007243    .0492255   1.70e-07   .9153921
{txt}{space 10}pe {c |}{res}      5,221    .0065986    .0429975   1.62e-07   .6436663
{txt}
{com}.         
. *** QIs across t        
. bys time: egen ape_t = mean(pe)
{txt}
{com}. bys time: egen sdpe_t = sd(pe)
{txt}
{com}. bys time: egen minpe_t = min(pe)
{txt}
{com}. bys time: egen maxpe_t = max(pe)
{txt}
{com}. 
. twoway (scatter pe time, jitter(3)) (line ape_t time), ytitle("{c -(}&Delta{c )-}Pr(Y=1)") xtitle("Years Since Last Pursuit") legend(off) 
{res}{txt}
{com}. twoway (scatter pe time, jitter(3)) (line sdpe_t time)
{res}{txt}
{com}. 
. *** Create a dataset to generate the figure in R
. preserve
{txt}
{com}.         keep pe time ape_t sdpe_t minpe_t maxpe_t
{txt}
{com}.         saveold "Way and Weeks 2014\Data\WW2.dta", replace version(12)
{txt}{p 0 1 2}
(saving in Stata 12 format, which can be read
by Stata 11 or 12)
{p_end}
file Way and Weeks 2014\Data\WW2.dta saved

{com}.         
.         duplicates drop time, force

{p 0 4}{txt}Duplicates in terms of {res} time{p_end}

{txt}(5,166 observations deleted)

{com}.         list
{txt}
     {c TLC}{hline 6}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c TRC}
     {c |} {res}time         pe      ape_t     sdpe_t    minpe_t    maxpe_t {txt}{c |}
     {c LT}{hline 6}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
  1. {c |} {res}   0   .0070024   .1162151   .1636598   .0008511   .6436663 {txt}{c |}
  2. {c |} {res}   1    .002108   .0183996   .0715077   .0000931   .5647773 {txt}{c |}
  3. {c |} {res}   2   .0000822   .0091146   .0410763   .0000301   .3679192 {txt}{c |}
  4. {c |} {res}   3   .0001165   .0042753   .0208691   .0000135   .1950432 {txt}{c |}
  5. {c |} {res}   4   .0000146   .0019688   .0102865   8.07e-06   .0990506 {txt}{c |}
     {c LT}{hline 6}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
  6. {c |} {res}   5   .0004472   .0010128   .0053442   3.68e-06   .0509835 {txt}{c |}
  7. {c |} {res}   6   .0001048   .0005599    .002921   2.02e-06   .0275188 {txt}{c |}
  8. {c |} {res}   7   .0004321   .0003232   .0016786   1.14e-06   .0160312 {txt}{c |}
  9. {c |} {res}   8   .0000366   .0002089   .0010694   6.25e-07    .010067 {txt}{c |}
 10. {c |} {res}   9   .0000207   .0001449   .0007375   4.17e-07   .0067907 {txt}{c |}
     {c LT}{hline 6}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
 11. {c |} {res}  10   2.29e-06   .0000901   .0005361   3.12e-07   .0049548 {txt}{c |}
 12. {c |} {res}  11    .000187   .0000352   .0001973   2.32e-07   .0020149 {txt}{c |}
 13. {c |} {res}  12   .0000212   .0000281   .0001578   1.96e-07   .0016184 {txt}{c |}
 14. {c |} {res}  13   .0000552   .0000256   .0001423   1.82e-07   .0014586 {txt}{c |}
 15. {c |} {res}  14   5.63e-07   .0000244   .0001372   1.62e-07   .0014007 {txt}{c |}
     {c LT}{hline 6}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
 16. {c |} {res}  15   1.32e-06   .0000258   .0001376   1.64e-07   .0014103 {txt}{c |}
 17. {c |} {res}  16   4.64e-06   .0000243   .0001404   1.70e-07   .0014529 {txt}{c |}
 18. {c |} {res}  17   5.71e-07   .0000259   .0001509   1.82e-07    .001576 {txt}{c |}
 19. {c |} {res}  18   4.34e-06   .0000298   .0001723   2.01e-07   .0017833 {txt}{c |}
 20. {c |} {res}  19   2.35e-06   .0000357   .0001926   2.42e-07   .0020145 {txt}{c |}
     {c LT}{hline 6}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
 21. {c |} {res}  20   8.75e-06    .000044   .0002299   2.85e-07   .0023515 {txt}{c |}
 22. {c |} {res}  21   .0029702    .000054   .0002876   3.55e-07   .0029702 {txt}{c |}
 23. {c |} {res}  22   .0000131   .0000717   .0003739   4.66e-07   .0037892 {txt}{c |}
 24. {c |} {res}  23   .0000209   .0000924   .0004836   6.08e-07   .0049468 {txt}{c |}
 25. {c |} {res}  24   9.66e-06   .0001263   .0006629   8.29e-07    .006655 {txt}{c |}
     {c LT}{hline 6}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
 26. {c |} {res}  25   .0003659   .0001652   .0008675   1.09e-06   .0088228 {txt}{c |}
 27. {c |} {res}  26    .000157    .000233   .0011807   1.57e-06    .011652 {txt}{c |}
 28. {c |} {res}  27   .0000989   .0003218   .0015867   2.13e-06   .0154673 {txt}{c |}
 29. {c |} {res}  28   5.96e-06   .0004589   .0021612   2.91e-06   .0211303 {txt}{c |}
 30. {c |} {res}  29   .0000328   .0006745   .0030809   3.97e-06    .028848 {txt}{c |}
     {c LT}{hline 6}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
 31. {c |} {res}  30   .0001063   .0009087   .0041426   5.74e-06   .0388894 {txt}{c |}
 32. {c |} {res}  31   .0000457   .0012356   .0055949   7.85e-06   .0522718 {txt}{c |}
 33. {c |} {res}  32   .0000652   .0016078   .0072741   5.97e-06    .068481 {txt}{c |}
 34. {c |} {res}  33   .0000767   .0017727    .008952   7.73e-06   .0893374 {txt}{c |}
 35. {c |} {res}  34   .0000904   .0022591   .0113441   9.65e-06    .113755 {txt}{c |}
     {c LT}{hline 6}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
 36. {c |} {res}  35   .0028497   .0035114   .0161183    .000012   .1424011 {txt}{c |}
 37. {c |} {res}  36   .0002469    .002029    .005122   .0000147   .0442163 {txt}{c |}
 38. {c |} {res}  37   .0030377    .003207   .0116698   .0000176   .1063759 {txt}{c |}
 39. {c |} {res}  38   .0043218   .0036913   .0131304   .0000203    .119444 {txt}{c |}
 40. {c |} {res}  39   .0103408   .0042581   .0149997   .0000214   .1313368 {txt}{c |}
     {c LT}{hline 6}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
 41. {c |} {res}  40   .0012778   .0046486   .0163566    .000023   .1395185 {txt}{c |}
 42. {c |} {res}  41    .019964   .0055542   .0188848   .0000655   .1430602 {txt}{c |}
 43. {c |} {res}  42   .0079015   .0054119   .0185332   .0000654   .1410191 {txt}{c |}
 44. {c |} {res}  43   .0006341   .0050224   .0177319   .0000615   .1344229 {txt}{c |}
 45. {c |} {res}  44    .002757    .005332   .0168154   .0000541   .1217712 {txt}{c |}
     {c LT}{hline 6}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
 46. {c |} {res}  45   .0073498   .0056912   .0208107    .000044   .1188431 {txt}{c |}
 47. {c |} {res}  46   .0007706   .0023945   .0069056   .0000337   .0474623 {txt}{c |}
 48. {c |} {res}  47   .0001351   .0018886   .0053578   .0000243   .0363607 {txt}{c |}
 49. {c |} {res}  48    .000077   .0013037   .0035984   .0000158   .0233364 {txt}{c |}
 50. {c |} {res}  49   .0002589   .0008738   .0023908   9.82e-06   .0152751 {txt}{c |}
     {c LT}{hline 6}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
 51. {c |} {res}  50   .0001122   .0005287   .0014591   6.11e-06   .0092773 {txt}{c |}
 52. {c |} {res}  51   .0000153   .0002767   .0007881   3.41e-06   .0051661 {txt}{c |}
 53. {c |} {res}  52   1.59e-06   .0001406   .0003953   1.59e-06   .0025594 {txt}{c |}
 54. {c |} {res}  53   .0000598   .0000635    .000174   7.34e-07   .0011026 {txt}{c |}
 55. {c |} {res}  54   3.49e-06   .0000265   .0000737   3.24e-07   .0004666 {txt}{c |}
     {c BLC}{hline 6}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c BRC}

{com}. restore
{txt}
{com}. 
. 
. *****************************************************************
. *** Cunningham (2013, AJPS), Model 2
. *****************************************************************
. use "Cunningham 2013\CunninghamAJPS.dta", clear
{txt}
{com}. gen id = _n
{txt}
{com}. 
. *** Logit replication
. logit acdcivilwar1 logfactions prevconcessions_l democracy kin yrsnocivilwar _spline1_cw _spline2_cw _spline3_cw , robust cluster(kgcid)

{res}{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-1724.7768}  
Iteration 1:{space 3}log pseudolikelihood = {res:-884.15508}  
Iteration 2:{space 3}log pseudolikelihood = {res: -771.5549}  
Iteration 3:{space 3}log pseudolikelihood = {res:-759.52013}  
Iteration 4:{space 3}log pseudolikelihood = {res:-759.16487}  
Iteration 5:{space 3}log pseudolikelihood = {res:-759.16397}  
Iteration 6:{space 3}log pseudolikelihood = {res:-759.16397}  
{res}
{txt}Logistic regression{col 49}Number of obs{col 67}= {res}     3,254
{txt}{col 49}Wald chi2({res}8{txt}){col 67}= {res}    575.98
{txt}{col 49}Prob > chi2{col 67}= {res}    0.0000
{txt}Log pseudolikelihood = {res}-759.16397{txt}{col 49}Pseudo R2{col 67}= {res}    0.5598

{txt}{ralign 83:(Std. Err. adjusted for {res:118} clusters in kgcid)}
{hline 18}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 19}{c |}{col 31}    Robust
{col 1}     acdcivilwar1{col 19}{c |}      Coef.{col 31}   Std. Err.{col 43}      z{col 51}   P>|z|{col 59}     [95% Con{col 72}f. Interval]
{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 6}logfactions {c |}{col 19}{res}{space 2} .6931011{col 31}{space 2} .1422056{col 42}{space 1}    4.87{col 51}{space 3}0.000{col 59}{space 4} .4143832{col 72}{space 3}  .971819
{txt}prevconcessions_l {c |}{col 19}{res}{space 2}-.1513925{col 31}{space 2}  .222197{col 42}{space 1}   -0.68{col 51}{space 3}0.496{col 59}{space 4}-.5868906{col 72}{space 3} .2841056
{txt}{space 8}democracy {c |}{col 19}{res}{space 2}-.5831185{col 31}{space 2} .2516056{col 42}{space 1}   -2.32{col 51}{space 3}0.020{col 59}{space 4}-1.076256{col 72}{space 3}-.0899806
{txt}{space 14}kin {c |}{col 19}{res}{space 2} .0904087{col 31}{space 2} .2095698{col 42}{space 1}    0.43{col 51}{space 3}0.666{col 59}{space 4}-.3203406{col 72}{space 3}  .501158
{txt}{space 4}yrsnocivilwar {c |}{col 19}{res}{space 2}-1.458778{col 31}{space 2} .0955653{col 42}{space 1}  -15.26{col 51}{space 3}0.000{col 59}{space 4}-1.646082{col 72}{space 3}-1.271473
{txt}{space 6}_spline1_cw {c |}{col 19}{res}{space 2}-.0250924{col 31}{space 2} .0023146{col 42}{space 1}  -10.84{col 51}{space 3}0.000{col 59}{space 4} -.029629{col 72}{space 3}-.0205558
{txt}{space 6}_spline2_cw {c |}{col 19}{res}{space 2} .0077416{col 31}{space 2} .0009786{col 42}{space 1}    7.91{col 51}{space 3}0.000{col 59}{space 4} .0058235{col 72}{space 3} .0096597
{txt}{space 6}_spline3_cw {c |}{col 19}{res}{space 2}-.0007431{col 31}{space 2} .0003401{col 42}{space 1}   -2.18{col 51}{space 3}0.029{col 59}{space 4}-.0014098{col 72}{space 3}-.0000764
{txt}{space 12}_cons {c |}{col 19}{res}{space 2}  .738395{col 31}{space 2} .2209392{col 42}{space 1}    3.34{col 51}{space 3}0.001{col 59}{space 4} .3053621{col 72}{space 3} 1.171428
{txt}{hline 18}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. keep if e(sample)
{txt}(644 observations deleted)

{com}. 
. *** Linear probability model
. reg acdcivilwar1 logfactions prevconcessions_l democracy kin yrsnocivilwar _spline1_cw _spline2_cw _spline3_cw , robust cluster(kgcid)

{txt}Linear regression                               Number of obs     = {res}     3,254
                                                {txt}F(8, 117)         =  {res}   108.88
                                                {txt}Prob > F          = {res}    0.0000
                                                {txt}R-squared         = {res}    0.5788
                                                {txt}Root MSE          =    {res} .27029

{txt}{ralign 83:(Std. Err. adjusted for {res:118} clusters in kgcid)}
{hline 18}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 19}{c |}{col 31}    Robust
{col 1}     acdcivilwar1{col 19}{c |}      Coef.{col 31}   Std. Err.{col 43}      t{col 51}   P>|t|{col 59}     [95% Con{col 72}f. Interval]
{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 6}logfactions {c |}{col 19}{res}{space 2} .0543611{col 31}{space 2} .0115912{col 42}{space 1}    4.69{col 51}{space 3}0.000{col 59}{space 4} .0314052{col 72}{space 3} .0773169
{txt}prevconcessions_l {c |}{col 19}{res}{space 2}-.0014676{col 31}{space 2}  .018189{col 42}{space 1}   -0.08{col 51}{space 3}0.936{col 59}{space 4}-.0374901{col 72}{space 3} .0345548
{txt}{space 8}democracy {c |}{col 19}{res}{space 2}-.0419358{col 31}{space 2} .0194228{col 42}{space 1}   -2.16{col 51}{space 3}0.033{col 59}{space 4}-.0804017{col 72}{space 3}  -.00347
{txt}{space 14}kin {c |}{col 19}{res}{space 2} .0065649{col 31}{space 2} .0153419{col 42}{space 1}    0.43{col 51}{space 3}0.670{col 59}{space 4} -.023819{col 72}{space 3} .0369487
{txt}{space 4}yrsnocivilwar {c |}{col 19}{res}{space 2}-.2014077{col 31}{space 2} .0090223{col 42}{space 1}  -22.32{col 51}{space 3}0.000{col 59}{space 4}-.2192758{col 72}{space 3}-.1835395
{txt}{space 6}_spline1_cw {c |}{col 19}{res}{space 2} -.003355{col 31}{space 2} .0001642{col 42}{space 1}  -20.43{col 51}{space 3}0.000{col 59}{space 4}-.0036802{col 72}{space 3}-.0030298
{txt}{space 6}_spline2_cw {c |}{col 19}{res}{space 2} .0010375{col 31}{space 2} .0000555{col 42}{space 1}   18.70{col 51}{space 3}0.000{col 59}{space 4} .0009277{col 72}{space 3} .0011474
{txt}{space 6}_spline3_cw {c |}{col 19}{res}{space 2}-.0001148{col 31}{space 2} .0000107{col 42}{space 1}  -10.73{col 51}{space 3}0.000{col 59}{space 4} -.000136{col 72}{space 3}-.0000936
{txt}{space 12}_cons {c |}{col 19}{res}{space 2} .6939898{col 31}{space 2} .0314094{col 42}{space 1}   22.09{col 51}{space 3}0.000{col 59}{space 4} .6317852{col 72}{space 3} .7561944
{txt}{hline 18}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. di _b[logfactions] * 3.66
{res}.19896155
{txt}
{com}. 
. *** Replication of substantive effects
. estsimp logit acdcivilwar1 logfactions prevconcessions_l democracy kin yrsnocivilwar _spline1_cw _spline2_cw _spline3_cw , robust cluster(kgcid)

{txt}Iteration 0:   log pseudolikelihood = {res}-1724.7768
{txt}Iteration 1:   log pseudolikelihood = {res}-884.15508
{txt}Iteration 2:   log pseudolikelihood = {res}-774.40472
{txt}Iteration 3:   log pseudolikelihood = {res}-760.23623
{txt}Iteration 4:   log pseudolikelihood = {res}-759.19636
{txt}Iteration 5:   log pseudolikelihood = {res}-759.16407
{txt}Iteration 6:   log pseudolikelihood = {res}-759.16397

{txt}Logistic regression                               Number of obs   = {res}      3254
                                                  {txt}Wald chi2({res}8{txt})    = {res}    575.98
                                                  {txt}Prob > chi2     = {res}    0.0000
{txt}Log pseudolikelihood = {res}-759.16397                 {txt}Pseudo R2       = {res}    0.5598

                                {txt}(Std. Err. adjusted for {res}118{txt} clusters in kgcid)
{hline 13}{c TT}{hline 64}
             {c |}               Robust
acdcivilwar1 {c |}      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
{hline 13}{c +}{hline 64}
 logfactions {c |}  {res} .6931011   .1422056     4.87   0.000     .4143833    .9718188
{txt}prevconces~l {c |}  {res}-.1513925   .2221969    -0.68   0.496    -.5868905    .2841054
   {txt}democracy {c |}  {res}-.5831185   .2516055    -2.32   0.020    -1.076256   -.0899808
         {txt}kin {c |}  {res} .0904087   .2095697     0.43   0.666    -.3203405    .5011579
{txt}yrsnocivil~r {c |}  {res}-1.458778   .0955653   -15.26   0.000    -1.646082   -1.271473
 {txt}_spline1_cw {c |}  {res}-.0250924   .0023146   -10.84   0.000     -.029629   -.0205558
 {txt}_spline2_cw {c |}  {res} .0077416   .0009786     7.91   0.000     .0058235    .0096597
 {txt}_spline3_cw {c |}  {res}-.0007431   .0003401    -2.18   0.029    -.0014098   -.0000765
       {txt}_cons {c |}  {res}  .738395   .2209392     3.34   0.001     .3053622    1.171428
{txt}{hline 13}{c BT}{hline 64}

{res}Simulating main parameters.  Please wait....
% of simulations completed: 11% 22% 33% 44% 55% 66% 77% 88% 100% 

Number of simulations  : 1000
Names of new variables : b1 b2 b3 b4 b5 b6 b7 b8 b9
{txt}
{com}. 
. * Logged Factions
. setx mean
{txt}
{com}. setx prevconcessions_l 0 democracy 0 kin 0 
{txt}
{com}. simqi, fd(prval(1)) changex(logfactions 0 3.66)

{res}First Difference: logfactions 0 3.66

{txt}      Quantity of Interest |     Mean       Std. Err.    [95% Conf. Interval]
---------------------------+--------------------------------------------------
         dPr(acdciv~1 = 1) |  {res} .3712181     .1121238     .1538176     .604289
{txt}
{com}. 
. * Democracy
. setx mean
{txt}
{com}. setx prevconcessions_l 0 democracy 0 kin 0 
{txt}
{com}. simqi, fd(prval(1)) changex(democracy 0 1)

{res}First Difference: democracy 0 1

{txt}      Quantity of Interest |     Mean       Std. Err.    [95% Conf. Interval]
---------------------------+--------------------------------------------------
         dPr(acdciv~1 = 1) |  {res}-.0398137      .018495    -.0784567   -.0036751
{txt}
{com}. 
. *** Overall average partial effect and standard deviation of partial effect
. logit acdcivilwar1 logfactions prevconcessions_l democracy kin yrsnocivilwar _spline1_cw _spline2_cw _spline3_cw , robust cluster(kgcid)

{res}{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-1724.7768}  
Iteration 1:{space 3}log pseudolikelihood = {res:-884.15508}  
Iteration 2:{space 3}log pseudolikelihood = {res: -771.5549}  
Iteration 3:{space 3}log pseudolikelihood = {res:-759.52013}  
Iteration 4:{space 3}log pseudolikelihood = {res:-759.16487}  
Iteration 5:{space 3}log pseudolikelihood = {res:-759.16397}  
Iteration 6:{space 3}log pseudolikelihood = {res:-759.16397}  
{res}
{txt}Logistic regression{col 49}Number of obs{col 67}= {res}     3,254
{txt}{col 49}Wald chi2({res}8{txt}){col 67}= {res}    575.98
{txt}{col 49}Prob > chi2{col 67}= {res}    0.0000
{txt}Log pseudolikelihood = {res}-759.16397{txt}{col 49}Pseudo R2{col 67}= {res}    0.5598

{txt}{ralign 83:(Std. Err. adjusted for {res:118} clusters in kgcid)}
{hline 18}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 19}{c |}{col 31}    Robust
{col 1}     acdcivilwar1{col 19}{c |}      Coef.{col 31}   Std. Err.{col 43}      z{col 51}   P>|z|{col 59}     [95% Con{col 72}f. Interval]
{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 6}logfactions {c |}{col 19}{res}{space 2} .6931011{col 31}{space 2} .1422056{col 42}{space 1}    4.87{col 51}{space 3}0.000{col 59}{space 4} .4143832{col 72}{space 3}  .971819
{txt}prevconcessions_l {c |}{col 19}{res}{space 2}-.1513925{col 31}{space 2}  .222197{col 42}{space 1}   -0.68{col 51}{space 3}0.496{col 59}{space 4}-.5868906{col 72}{space 3} .2841056
{txt}{space 8}democracy {c |}{col 19}{res}{space 2}-.5831185{col 31}{space 2} .2516056{col 42}{space 1}   -2.32{col 51}{space 3}0.020{col 59}{space 4}-1.076256{col 72}{space 3}-.0899806
{txt}{space 14}kin {c |}{col 19}{res}{space 2} .0904087{col 31}{space 2} .2095698{col 42}{space 1}    0.43{col 51}{space 3}0.666{col 59}{space 4}-.3203406{col 72}{space 3}  .501158
{txt}{space 4}yrsnocivilwar {c |}{col 19}{res}{space 2}-1.458778{col 31}{space 2} .0955653{col 42}{space 1}  -15.26{col 51}{space 3}0.000{col 59}{space 4}-1.646082{col 72}{space 3}-1.271473
{txt}{space 6}_spline1_cw {c |}{col 19}{res}{space 2}-.0250924{col 31}{space 2} .0023146{col 42}{space 1}  -10.84{col 51}{space 3}0.000{col 59}{space 4} -.029629{col 72}{space 3}-.0205558
{txt}{space 6}_spline2_cw {c |}{col 19}{res}{space 2} .0077416{col 31}{space 2} .0009786{col 42}{space 1}    7.91{col 51}{space 3}0.000{col 59}{space 4} .0058235{col 72}{space 3} .0096597
{txt}{space 6}_spline3_cw {c |}{col 19}{res}{space 2}-.0007431{col 31}{space 2} .0003401{col 42}{space 1}   -2.18{col 51}{space 3}0.029{col 59}{space 4}-.0014098{col 72}{space 3}-.0000764
{txt}{space 12}_cons {c |}{col 19}{res}{space 2}  .738395{col 31}{space 2} .2209392{col 42}{space 1}    3.34{col 51}{space 3}0.001{col 59}{space 4} .3053621{col 72}{space 3} 1.171428
{txt}{hline 18}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. 
. predict base, pr
{txt}
{com}. 
. tempvar pr_0 pr_1 
{txt}
{com}. replace logfactions = 0
{txt}(2,210 real changes made)

{com}. predict `pr_0', pr
{txt}
{com}. 
. replace logfactions = 3.66
{txt}(3,254 real changes made)

{com}. predict `pr_1', pr
{txt}
{com}. gen pe = `pr_1' - `pr_0'
{txt}
{com}. 
. qui sum pe
{txt}
{com}. local ape = round(r(mean), 0.001)
{txt}
{com}. local sdpe = round(r(sd), 0.001)
{txt}
{com}. 
. di "Average partial effect = " `ape'
{res}Average partial effect = .203
{txt}
{com}. di "Standard deviation of partial effect = " `sdpe'
{res}Standard deviation of partial effect = .141
{txt}
{com}. 
. sum base `pr_0' `pr_1' pe

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}base {c |}{res}      3,254    .2224954    .3233997   .0022031   .9418546
{txt}{space 4}__000002 {c |}{res}      3,254    .1716756    .2608222    .002013   .6961019
{txt}{space 4}__000003 {c |}{res}      3,254    .3748129      .36291   .0248595   .9666105
{txt}{space 10}pe {c |}{res}      3,254    .2031373    .1411582   .0228464   .5609009
{txt}
{com}. 
. preserve
{txt}
{com}.         keep id pe
{txt}
{com}.         rename pe pe_lf
{res}{txt}
{com}.         sort id
{txt}
{com}.         tempfile data
{txt}
{com}.         save `data', replace
{txt}(note: file C:\Users\WILLIA~1\AppData\Local\Temp\ST_0k000003.tmp not found)
file C:\Users\WILLIA~1\AppData\Local\Temp\ST_0k000003.tmp saved

{com}. restore 
{txt}
{com}.         
. bys yrsnocivilwar: egen ape_t = mean(pe)
{txt}
{com}. bys yrsnocivilwar: egen sdpe_t = sd(pe)
{txt}
{com}. bys yrsnocivilwar: egen minpe_t = min(pe)
{txt}
{com}. bys yrsnocivilwar: egen maxpe_t = max(pe)
{txt}
{com}. 
. twoway (scatter pe yrsnocivilwar, jitter(3)) (line ape_t yrsnocivilwar), ytitle("{c -(}&Delta{c )-}Pr(Y=1)") xtitle("Time Since Civil War Incidence") legend(off) 
{res}{txt}
{com}. twoway (scatter pe yrsnocivilwar, jitter(3)) (line sdpe_t yrsnocivilwar)
{res}{txt}
{com}. 
. preserve
{txt}
{com}.         rename yrsnocivilwar time
{res}{txt}
{com}.         keep pe time ape_t sdpe_t minpe_t maxpe_t
{txt}
{com}.         saveold "Cunningham 2013\Data\Cunningham.dta", replace version(12)
{txt}{p 0 1 2}
(saving in Stata 12 format, which can be read
by Stata 11 or 12)
{p_end}
file Cunningham 2013\Data\Cunningham.dta saved

{com}.         
.         duplicates drop time, force

{p 0 4}{txt}Duplicates in terms of {res} time{p_end}

{txt}(3,208 observations deleted)

{com}.         list time *_t
{txt}
     {c TLC}{hline 6}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c TRC}
     {c |} {res}time      ape_t     sdpe_t    minpe_t    maxpe_t {txt}{c |}
     {c LT}{hline 6}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
  1. {c |} {res}   0   .3247781   .0587511   .2705086   .4259708 {txt}{c |}
  2. {c |} {res}   1    .538187   .0165453   .5210545   .5609009 {txt}{c |}
  3. {c |} {res}   2   .4746847   .0489313   .3831321   .5187505 {txt}{c |}
  4. {c |} {res}   3   .2735368    .054465   .1860322   .3273024 {txt}{c |}
  5. {c |} {res}   4   .1521053   .0349146   .0940257   .1873492 {txt}{c |}
     {c LT}{hline 6}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
  6. {c |} {res}   5   .0959942   .0239895   .0578468   .1212809 {txt}{c |}
  7. {c |} {res}   6   .0740501   .0190781   .0439417   .0939839 {txt}{c |}
  8. {c |} {res}   7   .0680943   .0178606   .0401839   .0864146 {txt}{c |}
  9. {c |} {res}   8    .071237   .0189146   .0426281   .0913472 {txt}{c |}
 10. {c |} {res}   9    .078715   .0229257   .0503437   .1066892 {txt}{c |}
     {c LT}{hline 6}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
 11. {c |} {res}  10   .0969543     .02869   .0634325   .1319385 {txt}{c |}
 12. {c |} {res}  11   .1191129   .0346939   .0817296   .1656655 {txt}{c |}
 13. {c |} {res}  12   .1509822   .0419555   .1034239   .2034117 {txt}{c |}
 14. {c |} {res}  13   .1787871   .0472594   .1247754   .2383269 {txt}{c |}
 15. {c |} {res}  14   .2021319   .0512638   .1434886   .2672081 {txt}{c |}
     {c LT}{hline 6}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
 16. {c |} {res}  15   .2263474   .0535973   .1582993    .288982 {txt}{c |}
 17. {c |} {res}  16   .2363478   .0554989   .1684992   .3034401 {txt}{c |}
 18. {c |} {res}  17   .2408232   .0564523   .1738999   .3109224 {txt}{c |}
 19. {c |} {res}  18   .2414493   .0553013    .174728   .3120591 {txt}{c |}
 20. {c |} {res}  19   .2333011   .0547499   .1715091   .3076246 {txt}{c |}
     {c LT}{hline 6}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
 21. {c |} {res}  20   .2271986   .0545991   .1649648   .2984788 {txt}{c |}
 22. {c |} {res}  21   .2192544   .0526544   .1559209   .2855482 {txt}{c |}
 23. {c |} {res}  22   .2067695   .0504304   .1452312   .2698189 {txt}{c |}
 24. {c |} {res}  23   .1910605   .0472198   .1336947   .2522874 {txt}{c |}
 25. {c |} {res}  24   .1773926   .0440821    .122034   .2339633 {txt}{c |}
     {c LT}{hline 6}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
 26. {c |} {res}  25   .1617989   .0415526   .1108199     .21575 {txt}{c |}
 27. {c |} {res}  26   .1467476   .0396763   .1004987   .1984588 {txt}{c |}
 28. {c |} {res}  27   .1320546   .0375122   .0913023   .1826127 {txt}{c |}
 29. {c |} {res}  28   .1178282   .0342173   .0831552   .1682191 {txt}{c |}
 30. {c |} {res}  29   .1107935   .0325929   .0759274    .155163 {txt}{c |}
     {c LT}{hline 6}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
 31. {c |} {res}  30   .1060085    .031317   .0695017   .1433245 {txt}{c |}
 32. {c |} {res}  31   .0989308   .0289705   .0637742   .1325849 {txt}{c |}
 33. {c |} {res}  32   .0897612   .0266297    .058654   .1228317 {txt}{c |}
 34. {c |} {res}  33   .0825708   .0249017   .0540646   .1139652 {txt}{c |}
 35. {c |} {res}  34   .0752483   .0221563   .0499424   .1058996 {txt}{c |}
     {c LT}{hline 6}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
 36. {c |} {res}  35    .070649   .0209675   .0462232    .098539 {txt}{c |}
 37. {c |} {res}  36    .064375   .0194199   .0428581   .0918097 {txt}{c |}
 38. {c |} {res}  37   .0595431    .018296   .0397996   .0856357 {txt}{c |}
 39. {c |} {res}  38   .0557745   .0172799    .037018   .0799725 {txt}{c |}
 40. {c |} {res}  39   .0528762   .0169274   .0344705   .0747452 {txt}{c |}
     {c LT}{hline 6}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
 41. {c |} {res}  40   .0480269   .0157315   .0321367   .0699218 {txt}{c |}
 42. {c |} {res}  41   .0444477   .0148299   .0299869   .0654493 {txt}{c |}
 43. {c |} {res}  42    .041041   .0140108   .0279992   .0612888 {txt}{c |}
 44. {c |} {res}  43   .0383579   .0132687   .0261581   .0574133 {txt}{c |}
 45. {c |} {res}  44   .0356695   .0126956   .0244482    .053795 {txt}{c |}
     {c LT}{hline 6}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
 46. {c |} {res}  45   .0329739   .0119067   .0228464    .050389 {txt}{c |}
     {c BLC}{hline 6}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c BRC}

{com}. restore
{txt}
{com}. 
. preserve
{txt}
{com}.         rename yrsnocivilwar time
{res}{txt}
{com}.         keep time 
{txt}
{com}.         saveold "Cunningham 2013\Data\chist.dta", replace version(12)
{txt}{p 0 1 2}
(saving in Stata 12 format, which can be read
by Stata 11 or 12)
{p_end}
file Cunningham 2013\Data\chist.dta saved

{com}. restore
{txt}
{com}. 
. *** Average partial effects across other variables
. foreach v of varlist prevconcessions_l democracy kin {c -(}
{txt}  2{com}.         bys `v': egen ape_`v' = mean(pe)
{txt}  3{com}.         bys `v': egen sdpe_`v' = sd(pe)
{txt}  4{com}.         bys `v': egen minpe_`v' = min(pe)
{txt}  5{com}.         bys `v': egen maxpe_`v' = max(pe)
{txt}  6{com}.         
.         preserve
{txt}  7{com}.                 keep `v' *_`v'
{txt}  8{com}.                 duplicates drop `v', force
{txt}  9{com}.                 list `v' *_`v'
{txt} 10{com}.         restore
{txt} 11{com}. {c )-}

{p 0 4}{txt}Duplicates in terms of {res} prevconcessions_l{p_end}

{txt}(3,252 observations deleted)

     {c TLC}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c TRC}
     {c |} {res}prevco~l   ape_pr~l   sdpe_p~l   minpe_~l   maxpe_~l {txt}{c |}
     {c LT}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
  1. {c |} {res}       0   .2210285   .1340259   .0283112   .5609009 {txt}{c |}
  2. {c |} {res}       1   .1802596   .1466845   .0228464   .5603437 {txt}{c |}
     {c BLC}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c BRC}

{p 0 4}{txt}Duplicates in terms of {res} democracy{p_end}

{txt}(3,252 observations deleted)

     {c TLC}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c TRC}
     {c |} {res}democr~y   ape_de~y   sdpe_d~y   minpe_~y   maxpe_~y {txt}{c |}
     {c LT}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
  1. {c |} {res}       0   .2279018   .1278757   .0400782   .5446522 {txt}{c |}
  2. {c |} {res}       1   .1730457   .1504327   .0228464   .5609009 {txt}{c |}
     {c BLC}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c BRC}

{p 0 4}{txt}Duplicates in terms of {res} kin{p_end}

{txt}(3,252 observations deleted)

     {c TLC}{hline 5}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c TRC}
     {c |} {res}kin    ape_kin   sdpe_kin   minpe_~n   maxpe_~n {txt}{c |}
     {c LT}{hline 5}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c RT}
  1. {c |} {res}  0   .1841996   .1400738   .0228464   .5609009 {txt}{c |}
  2. {c |} {res}  1   .2139405   .1406687   .0249448   .5604122 {txt}{c |}
     {c BLC}{hline 5}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c -}{hline 10}{c BRC}

{com}. 
. 
. *** Average partial effect of democracy
. use "Cunningham 2013\CunninghamAJPS.dta", clear
{txt}
{com}. gen id = _n
{txt}
{com}. 
. preserve
{txt}
{com}.         qui logit acdcivilwar1 logfactions prevconcessions_l democracy kin yrsnocivilwar _spline1_cw _spline2_cw _spline3_cw , robust cluster(kgcid)
{txt}
{com}.         keep if e(sample)
{txt}(644 observations deleted)

{com}. 
.         tempvar pr_0 pr_1 
{txt}
{com}.         replace democracy = 0
{txt}(1,469 real changes made)

{com}.         predict `pr_0', pr
{txt}
{com}. 
.         replace democracy = 1
{txt}(3,254 real changes made)

{com}.         predict `pr_1', pr
{txt}
{com}.         gen pe = `pr_1' - `pr_0'
{txt}
{com}. 
.         qui sum pe
{txt}
{com}.         local ape = round(r(mean), 0.001)
{txt}
{com}.         local sdpe = round(r(sd), 0.001)
{txt}
{com}. 
.         di "Average partial effect = " `ape'
{res}Average partial effect = -.041
{txt}
{com}.         di "Standard deviation of partial effect = " `sdpe'
{res}Standard deviation of partial effect = .045
{txt}
{com}. 
.         sum `pr_0' `pr_1' pe

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 4}__000004 {c |}{res}      3,254    .2374235    .3331429   .0039402   .9666901
{txt}{space 4}__000005 {c |}{res}      3,254    .1966193    .2964478   .0022031   .9418546
{txt}{space 10}pe {c |}{res}      3,254   -.0408042    .0449595  -.1447242  -.0017371
{txt}
{com}. restore
{txt}
{com}. 
. *****************************************************************
. *** Flores-Macias and Kreps (2013, APSR)
. *****************************************************************
. use "Flores-Macias and Kreps 2013\Flores-MaciasKrepsAPSR.dta", clear
{txt}
{com}. 
. *** Linear probability model
. preserve
{txt}
{com}.         reg taxdummy party divided electionyear mid_sidea lagdebtgdp laginflationrate laggdpgrowth lagPerChangeDefExp type severity yearsnotax cubicspline1 cubicspline2 cubicspline3 if severity>3, vce(robust)

{txt}Linear regression                               Number of obs     = {res}       142
                                                {txt}F(14, 127)        =  {res}     2.06
                                                {txt}Prob > F          = {res}    0.0183
                                                {txt}R-squared         = {res}    0.2708
                                                {txt}Root MSE          =    {res} .30741

{txt}{hline 19}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 20}{c |}{col 32}    Robust
{col 1}          taxdummy{col 20}{c |}      Coef.{col 32}   Std. Err.{col 44}      t{col 52}   P>|t|{col 60}     [95% Con{col 73}f. Interval]
{hline 19}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 13}party {c |}{col 20}{res}{space 2} .2094996{col 32}{space 2} .0546018{col 43}{space 1}    3.84{col 52}{space 3}0.000{col 60}{space 4} .1014525{col 73}{space 3} .3175466
{txt}{space 11}divided {c |}{col 20}{res}{space 2}-.0477134{col 32}{space 2} .0479596{col 43}{space 1}   -0.99{col 52}{space 3}0.322{col 60}{space 4}-.1426168{col 73}{space 3} .0471901
{txt}{space 6}electionyear {c |}{col 20}{res}{space 2}  .017958{col 32}{space 2} .0567304{col 43}{space 1}    0.32{col 52}{space 3}0.752{col 60}{space 4}-.0943012{col 73}{space 3} .1302173
{txt}{space 9}mid_sidea {c |}{col 20}{res}{space 2}-.0156022{col 32}{space 2} .0547635{col 43}{space 1}   -0.28{col 52}{space 3}0.776{col 60}{space 4}-.1239694{col 73}{space 3} .0927649
{txt}{space 8}lagdebtgdp {c |}{col 20}{res}{space 2}-.0032479{col 32}{space 2} .0020343{col 43}{space 1}   -1.60{col 52}{space 3}0.113{col 60}{space 4}-.0072734{col 73}{space 3} .0007775
{txt}{space 2}laginflationrate {c |}{col 20}{res}{space 2}-.0051032{col 32}{space 2} .0049777{col 43}{space 1}   -1.03{col 52}{space 3}0.307{col 60}{space 4}-.0149532{col 73}{space 3} .0047468
{txt}{space 6}laggdpgrowth {c |}{col 20}{res}{space 2} .0130295{col 32}{space 2} .0086188{col 43}{space 1}    1.51{col 52}{space 3}0.133{col 60}{space 4}-.0040256{col 73}{space 3} .0300845
{txt}lagPerChangeDefExp {c |}{col 20}{res}{space 2} .0223419{col 32}{space 2}  .045989{col 43}{space 1}    0.49{col 52}{space 3}0.628{col 60}{space 4} -.068662{col 73}{space 3} .1133459
{txt}{space 14}type {c |}{col 20}{res}{space 2}-.1752364{col 32}{space 2} .1054793{col 43}{space 1}   -1.66{col 52}{space 3}0.099{col 60}{space 4}-.3839609{col 73}{space 3} .0334881
{txt}{space 10}severity {c |}{col 20}{res}{space 2} .1098692{col 32}{space 2} .0753391{col 43}{space 1}    1.46{col 52}{space 3}0.147{col 60}{space 4}-.0392132{col 73}{space 3} .2589517
{txt}{space 8}yearsnotax {c |}{col 20}{res}{space 2}-.0309142{col 32}{space 2} .0387172{col 43}{space 1}   -0.80{col 52}{space 3}0.426{col 60}{space 4}-.1075286{col 73}{space 3} .0457001
{txt}{space 6}cubicspline1 {c |}{col 20}{res}{space 2}  .577021{col 32}{space 2} .7214845{col 43}{space 1}    0.80{col 52}{space 3}0.425{col 60}{space 4}-.8506667{col 73}{space 3} 2.004709
{txt}{space 6}cubicspline2 {c |}{col 20}{res}{space 2}-1.044765{col 32}{space 2} 1.276004{col 43}{space 1}   -0.82{col 52}{space 3}0.414{col 60}{space 4}-3.569747{col 73}{space 3} 1.480218
{txt}{space 6}cubicspline3 {c |}{col 20}{res}{space 2} .6030274{col 32}{space 2} .6943171{col 43}{space 1}    0.87{col 52}{space 3}0.387{col 60}{space 4}-.7709008{col 73}{space 3} 1.976956
{txt}{space 13}_cons {c |}{col 20}{res}{space 2}-.1693337{col 32}{space 2} .4512201{col 43}{space 1}   -0.38{col 52}{space 3}0.708{col 60}{space 4}-1.062217{col 73}{space 3} .7235493
{txt}{hline 19}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}.         di _b[party]
{res}.20949957
{txt}
{com}. restore
{txt}
{com}. 
. *** Flores-Macias and Kreps replication
. preserve
{txt}
{com}.         * Table 3 (page 842)
.         estsimp logit taxdummy party divided electionyear mid_sidea lagdebtgdp laginflationrate laggdpgrowth lagPerChangeDefExp type severity yearsnotax cubicspline1 cubicspline2 cubicspline3 if severity>3, vce(robust)

{txt}Iteration 0:   log pseudolikelihood = {res}-55.884426
{txt}Iteration 1:   log pseudolikelihood = {res}-41.737064
{txt}Iteration 2:   log pseudolikelihood = {res}-37.230204
{txt}Iteration 3:   log pseudolikelihood = {res}-36.692792
{txt}Iteration 4:   log pseudolikelihood = {res}-36.663861
{txt}Iteration 5:   log pseudolikelihood = {res}-36.663619

{txt}Logistic regression                               Number of obs   = {res}       142
                                                  {txt}Wald chi2({res}14{txt})   = {res}     37.67
                                                  {txt}Prob > chi2     = {res}    0.0006
{txt}Log pseudolikelihood = {res}-36.663619                 {txt}Pseudo R2       = {res}    0.3439

{txt}{hline 13}{c TT}{hline 64}
             {c |}               Robust
    taxdummy {c |}      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
{hline 13}{c +}{hline 64}
       party {c |}  {res} 2.894566   1.177912     2.46   0.014     .5859016     5.20323
     {txt}divided {c |}  {res} -.815914   .8921436    -0.91   0.360    -2.564483    .9326553
{txt}electionyear {c |}  {res} .0468126    .665651     0.07   0.944    -1.257839    1.351465
   {txt}mid_sidea {c |}  {res} .3993134   .7650132     0.52   0.602    -1.100085    1.898712
  {txt}lagdebtgdp {c |}  {res}-.0240119   .0163812    -1.47   0.143    -.0561184    .0080946
{txt}laginflati~e {c |}  {res}-.0606471   .0637934    -0.95   0.342    -.1856798    .0643856
{txt}laggdpgrowth {c |}  {res} .1016487   .0835548     1.22   0.224    -.0621158    .2654132
{txt}lagPerChan~p {c |}  {res} .1388104   .3150879     0.44   0.660    -.4787505    .7563712
        {txt}type {c |}  {res}-1.062476   1.062298    -1.00   0.317    -3.144543     1.01959
    {txt}severity {c |}  {res} 1.161764   .8928618     1.30   0.193    -.5882127    2.911741
  {txt}yearsnotax {c |}  {res}-.1257917   .5232846    -0.24   0.810    -1.151411    .8998274
{txt}cubicspline1 {c |}  {res} 2.089183   11.38531     0.18   0.854    -20.22561    24.40398
{txt}cubicspline2 {c |}  {res}-3.972055   20.45029    -0.19   0.846    -44.05389    36.10978
{txt}cubicspline3 {c |}  {res} 2.679814   11.29498     0.24   0.812    -19.45794    24.81756
       {txt}_cons {c |}  {res}-7.921352   4.771675    -1.66   0.097    -17.27366    1.430958
{txt}{hline 13}{c BT}{hline 64}

{res}Simulating main parameters.  Please wait....

Note: Clarify is expanding your dataset from 223 observations to 1000
observations in order to accommodate the simulations.  This will append
missing values to the bottom of your original dataset.

% of simulations completed: 6% 13% 20% 26% 33% 40% 46% 53% 60% 66% 73% 80% 86% 93% 100% 

Number of simulations  : 1000
Names of new variables : b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15
{txt}
{com}. 
.         * Set all continuous variables to means and dummy variables to medians 
.         setx divided median
{txt}
{com}.         setx lagdebtgdp mean
{txt}
{com}.         setx laggdpgrowth mean
{txt}
{com}.         setx lagPerChangeDefExp mean
{txt}
{com}.         setx type median
{txt}
{com}.         setx yearsnotax mean
{txt}
{com}.         setx cubicspline1 mean
{txt}
{com}.         setx cubicspline2 mean
{txt}
{com}.         setx cubicspline3 mean
{txt}
{com}.         setx electionyear median
{txt}
{com}.         setx party median
{txt}
{com}.         
.         simqi, listx

You have set the following values for the explanatory variables:

{txt}{hline 10}{c TT}{hline 25}
 Variable {c |}    Value     Description
{hline 10}{c +}{hline 25}
 cubics~1 {c |}   {res}5.821377       mean   
 {txt}cubics~2 {c |}   {res}3.682676       mean   
 {txt}cubics~3 {c |}   {res}1.355516       mean   
  {txt}divided {c |}          {res}0      median  
 {txt}electi~r {c |}          {res}0      median  
 {txt}lagPer~p {c |}   {res}.2184289       mean   
 {txt}lagdeb~p {c |}   {res}33.49636       mean   
 {txt}laggdp~h {c |}   {res}3.839006       mean   
 {txt}laginf~e {c |}          {res}0     default  
 {txt}mid_si~a {c |}          {res}0     default  
    {txt}party {c |}          {res}1      median  
 {txt}severity {c |}          {res}0     default  
     {txt}type {c |}          {res}0      median  
 {txt}yearsn~x {c |}   {res}14.39437       mean   
{txt}{hline 10}{c BT}{hline 25}


{res}Quantities of interest based on those explanatory values:

{txt}      Quantity of Interest |     Mean       Std. Err.    [95% Conf. Interval]
---------------------------+--------------------------------------------------
            Pr(taxdummy=0) |  {res} .9208597     .2022464     .1027818    .9999985
            {txt}Pr(taxdummy=1) |  {res} .0791403     .2022464     1.49e-06    .8972182
{txt}
{com}.         
.         * Calculate the marginal effect of the following variables on the probability of a war tax 
.         simqi, fd(pr) changex(party 0 1)

{res}First Difference: party 0 1

{txt}      Quantity of Interest |     Mean       Std. Err.    [95% Conf. Interval]
---------------------------+--------------------------------------------------
         dPr(taxdummy = 0) |  {res}-.0577506     .1424247     -.565301   -8.05e-07
         {txt}dPr(taxdummy = 1) |  {res} .0577506     .1424247     8.03e-07     .565301
{txt}
{com}.         simqi, fd(pr) changex(severity p25 p75)

{res}First Difference: severity p25 p75

{txt}      Quantity of Interest |     Mean       Std. Err.    [95% Conf. Interval]
---------------------------+--------------------------------------------------
         dPr(taxdummy = 0) |  {res}-.2180958     .1818565    -.5749825    .1021576
         {txt}dPr(taxdummy = 1) |  {res} .2180958     .1818565    -.1021576    .5749825
{txt}
{com}.         simqi, fd(pr) changex(mid_sidea 0 1)

{res}First Difference: mid_sidea 0 1

{txt}      Quantity of Interest |     Mean       Std. Err.    [95% Conf. Interval]
---------------------------+--------------------------------------------------
         dPr(taxdummy = 0) |  {res}-.0198369     .0636856     -.230315    .0395467
         {txt}dPr(taxdummy = 1) |  {res} .0198369     .0636856    -.0395467     .230315
{txt}
{com}.         simqi, fd(pr) changex(lagPerChangeDefExp p25 p75)

{res}First Difference: lagPerChangeDefExp p25 p75

{txt}      Quantity of Interest |     Mean       Std. Err.    [95% Conf. Interval]
---------------------------+--------------------------------------------------
         dPr(taxdummy = 0) |  {res}-.0001341     .0041612    -.0093336    .0086741
         {txt}dPr(taxdummy = 1) |  {res} .0001341     .0041612    -.0086741    .0093336
{txt}
{com}.         simqi, fd(pr) changex(electionyear 0 1)

{res}First Difference: electionyear 0 1

{txt}      Quantity of Interest |     Mean       Std. Err.    [95% Conf. Interval]
---------------------------+--------------------------------------------------
         dPr(taxdummy = 0) |  {res}-.0008683       .04918    -.1117468    .0957767
         {txt}dPr(taxdummy = 1) |  {res} .0008683       .04918    -.0957768    .1117468
{txt}
{com}.         simqi, fd(pr) changex(laggdpgrowth p25 p75)

{res}First Difference: laggdpgrowth p25 p75

{txt}      Quantity of Interest |     Mean       Std. Err.    [95% Conf. Interval]
---------------------------+--------------------------------------------------
         dPr(taxdummy = 0) |  {res}-.0161836     .0367924    -.1491646    .0001557
         {txt}dPr(taxdummy = 1) |  {res} .0161836     .0367924    -.0001557    .1491646
{txt}
{com}.         simqi, fd(pr) changex(type 0 1)

{res}First Difference: type 0 1

{txt}      Quantity of Interest |     Mean       Std. Err.    [95% Conf. Interval]
---------------------------+--------------------------------------------------
         dPr(taxdummy = 0) |  {res} .0292046      .087733    -.0210527    .2860499
         {txt}dPr(taxdummy = 1) |  {res}-.0292046      .087733    -.2860499    .0210526
{txt}
{com}.         simqi, fd(pr) changex(divided 0 1)

{res}First Difference: divided 0 1

{txt}      Quantity of Interest |     Mean       Std. Err.    [95% Conf. Interval]
---------------------------+--------------------------------------------------
         dPr(taxdummy = 0) |  {res} .0095946     .0560848    -.0734535    .1663052
         {txt}dPr(taxdummy = 1) |  {res}-.0095946     .0560848    -.1663052    .0734535
{txt}
{com}.         simqi, fd(pr) changex(laginflationrate p25 p75)

{res}First Difference: laginflationrate p25 p75

{txt}      Quantity of Interest |     Mean       Std. Err.    [95% Conf. Interval]
---------------------------+--------------------------------------------------
         dPr(taxdummy = 0) |  {res} .0102783     .0300964    -.0057154    .1094468
         {txt}dPr(taxdummy = 1) |  {res}-.0102783     .0300964    -.1094467    .0057154
{txt}
{com}.         simqi, fd(pr) changex(lagdebtgdp p25 p75)

{res}First Difference: lagdebtgdp p25 p75

{txt}      Quantity of Interest |     Mean       Std. Err.    [95% Conf. Interval]
---------------------------+--------------------------------------------------
         dPr(taxdummy = 0) |  {res} .0366341     .0797921    -.0005043    .3024451
         {txt}dPr(taxdummy = 1) |  {res}-.0366341     .0797921    -.3024451    .0005043
{txt}
{com}. restore
{txt}
{com}. 
. qui logit taxdummy party divided electionyear mid_sidea lagdebtgdp laginflationrate laggdpgrowth lagPerChangeDefExp type severity yearsnotax cubicspline1 cubicspline2 cubicspline3 if severity>3, vce(robust)
{txt}
{com}. keep if e(sample)
{txt}(81 observations deleted)

{com}. local end = e(N)
{txt}
{com}. mat bl = e(b)'
{txt}
{com}. 
. *sum party divided electionyear mid_sidea lagdebtgdp laginflationrate laggdpgrowth lagPerChangeDefExp type severity yearsnotax cubicspline1 cubicspline2 cubicspline3, det
. 
. preserve
{txt}
{com}.         duplicates drop yearsnotax, force

{p 0 4}{txt}Duplicates in terms of {res} yearsnotax{p_end}

{txt}(98 observations deleted)

{com}.         keep yearsnotax cubic*
{txt}
{com}.         sort yearsnotax
{txt}
{com}.         mkmat yearsnotax cubicspline1-cubicspline3, mat(S)
{res}{txt}
{com}.         local r = rowsof(S)
{txt}
{com}.         local rminusone = `r' - 1
{txt}
{com}. restore
{txt}
{com}. 
. mat list S
{res}
{txt}S[44,4]
       yearsnotax  cubicspline1  cubicspline2  cubicspline3
 r1 {res}            1             0             0             0
{txt} r2 {res}            2      .0006313             0             0
{txt} r3 {res}            3      .0050504             0             0
{txt} r4 {res}            4       .017045             0             0
{txt} r5 {res}            5       .040403             0             0
{txt} r6 {res}            6      .0789121      .0006313             0
{txt} r7 {res}            7      .1363602      .0050504             0
{txt} r8 {res}            8      .2165349       .017045             0
{txt} r9 {res}            9     .32322419       .040403             0
{txt}r10 {res}           10     .46021569      .0789121             0
{txt}r11 {res}           11     .63129717      .1363602             0
{txt}r12 {res}           12     .84025657      .2165349             0
{txt}r13 {res}           13     1.0908819     .32322419      .0006313
{txt}r14 {res}           14       1.38696     .46021569      .0050504
{txt}r15 {res}           15       1.73228     .63129717       .017045
{txt}r16 {res}           16     2.1306281     .84025657       .040403
{txt}r17 {res}           18      3.101563       1.38696      .1363602
{txt}r18 {res}           19      3.681725       1.73228      .2165349
{txt}r19 {res}           20     4.3300681     2.1306281     .32322419
{txt}r20 {res}           21     5.0503769      2.585793     .46021569
{txt}r21 {res}           22     5.8464432      3.101563     .63129717
{txt}r22 {res}           23      6.720716     3.6805229     .83928949
{txt}r23 {res}           24      7.670301     4.3204498      1.083145
{txt}r24 {res}           25     8.6909676       5.01792     1.3608479
{txt}r25 {res}           26     9.7784843      5.769506      1.670385
{txt}r26 {res}           27      10.92862      6.571784     2.0097411
{txt}r27 {res}           28      12.13715     7.4213281     2.3769009
{txt}r28 {res}           29      13.39983     8.3147144       2.76985
{txt}r29 {res}           30      14.71243      9.248517      3.186573
{txt}r30 {res}           31      16.07074      10.21931      3.625056
{txt}r31 {res}           32     17.470501      11.22367     4.0832839
{txt}r32 {res}           33     18.907511      12.25817     4.5592418
{txt}r33 {res}           34      20.37751      13.31939     5.0509148
{txt}r34 {res}           35      21.87628       14.4039     5.5562878
{txt}r35 {res}           36     23.399599      15.50827      6.073348
{txt}r36 {res}           37      24.94322     16.629089     6.6000781
{txt}r37 {res}           38      26.50292      17.76292     7.1344638
{txt}r38 {res}           39     28.074459      18.90634     7.6744919
{txt}r39 {res}           40     29.653629      20.05592     8.2181463
{txt}r40 {res}           41     31.236179      21.20825     8.7634153
{txt}r41 {res}           42     32.819099      22.36087      9.308856
{txt}r42 {res}           43     34.402012       23.5135     9.8542967
{txt}r43 {res}           47     40.733669     28.123989      12.03606
{txt}r44 {res}           48     42.316582     29.276609       12.5815
{reset}
{com}. 
. di "Average case approach has the following values for the simulation scenario:"
{res}Average case approach has the following values for the simulation scenario:
{txt}
{com}. di "Years no tax = 14.4"
{res}Years no tax = 14.4
{txt}
{com}. di "Spline #1 = 5.8"
{res}Spline #1 = 5.8
{txt}
{com}. di "Spline #2 = 3.7"
{res}Spline #2 = 3.7
{txt}
{com}. di "Spline #3 = 1.4"
{res}Spline #3 = 1.4
{txt}
{com}. 
. estsimp logit taxdummy party divided electionyear mid_sidea lagdebtgdp laginflationrate laggdpgrowth lagPerChangeDefExp type severity yearsnotax cubicspline1 cubicspline2 cubicspline3 if severity>3, vce(robust)

{txt}Iteration 0:   log pseudolikelihood = {res}-55.884426
{txt}Iteration 1:   log pseudolikelihood = {res}-41.737064
{txt}Iteration 2:   log pseudolikelihood = {res}-37.230204
{txt}Iteration 3:   log pseudolikelihood = {res}-36.692792
{txt}Iteration 4:   log pseudolikelihood = {res}-36.663861
{txt}Iteration 5:   log pseudolikelihood = {res}-36.663619

{txt}Logistic regression                               Number of obs   = {res}       142
                                                  {txt}Wald chi2({res}14{txt})   = {res}     37.67
                                                  {txt}Prob > chi2     = {res}    0.0006
{txt}Log pseudolikelihood = {res}-36.663619                 {txt}Pseudo R2       = {res}    0.3439

{txt}{hline 13}{c TT}{hline 64}
             {c |}               Robust
    taxdummy {c |}      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
{hline 13}{c +}{hline 64}
       party {c |}  {res} 2.894566   1.177912     2.46   0.014     .5859016     5.20323
     {txt}divided {c |}  {res} -.815914   .8921436    -0.91   0.360    -2.564483    .9326553
{txt}electionyear {c |}  {res} .0468126    .665651     0.07   0.944    -1.257839    1.351465
   {txt}mid_sidea {c |}  {res} .3993134   .7650132     0.52   0.602    -1.100085    1.898712
  {txt}lagdebtgdp {c |}  {res}-.0240119   .0163812    -1.47   0.143    -.0561184    .0080946
{txt}laginflati~e {c |}  {res}-.0606471   .0637934    -0.95   0.342    -.1856798    .0643856
{txt}laggdpgrowth {c |}  {res} .1016487   .0835548     1.22   0.224    -.0621158    .2654132
{txt}lagPerChan~p {c |}  {res} .1388104   .3150879     0.44   0.660    -.4787505    .7563712
        {txt}type {c |}  {res}-1.062476   1.062298    -1.00   0.317    -3.144543     1.01959
    {txt}severity {c |}  {res} 1.161764   .8928618     1.30   0.193    -.5882127    2.911741
  {txt}yearsnotax {c |}  {res}-.1257917   .5232846    -0.24   0.810    -1.151411    .8998274
{txt}cubicspline1 {c |}  {res} 2.089183   11.38531     0.18   0.854    -20.22561    24.40398
{txt}cubicspline2 {c |}  {res}-3.972055   20.45029    -0.19   0.846    -44.05389    36.10978
{txt}cubicspline3 {c |}  {res} 2.679814   11.29498     0.24   0.812    -19.45794    24.81756
       {txt}_cons {c |}  {res}-7.921352   4.771675    -1.66   0.097    -17.27366    1.430958
{txt}{hline 13}{c BT}{hline 64}

{res}Simulating main parameters.  Please wait....

Note: Clarify is expanding your dataset from 142 observations to 1000
observations in order to accommodate the simulations.  This will append
missing values to the bottom of your original dataset.

% of simulations completed: 6% 13% 20% 26% 33% 40% 46% 53% 60% 66% 73% 80% 86% 93% 100% 

Number of simulations  : 1000
Names of new variables : b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15
{txt}
{com}. 
. * Not quite right
. setx mean
{txt}
{com}. setx divided 0 electionyear 0 mid_sidea 1 type 0 severity 4 
{txt}
{com}. simqi, fd(prval(1)) changex(party 0 1)

{res}First Difference: party 0 1

{txt}      Quantity of Interest |     Mean       Std. Err.    [95% Conf. Interval]
---------------------------+--------------------------------------------------
         dPr(taxdummy = 1) |  {res} .2277915     .1305362     .0399546    .5379996
{txt}
{com}. 
. qui foreach i in fd fd_lo fd_hi xaxis {c -(}
{txt}
{com}. 
. * Loop across (correct) values of t
. qui foreach s of numlist 1(1)`r' {c -(}
{txt}
{com}. 
. preserve
{txt}
{com}.         keep yearsnotax
{txt}
{com}.         saveold "Flores-Macias and Kreps 2013\Data\FMKdist.dta", replace version(12)
{txt}{p 0 1 2}
(saving in Stata 12 format, which can be read
by Stata 11 or 12)
{p_end}
file Flores-Macias and Kreps 2013\Data\FMKdist.dta saved

{com}. restore
{txt}
{com}. 
. *** Observed-values approach
. preserve
{txt}
{com}.         qui logit taxdummy party divided electionyear mid_sidea lagdebtgdp laginflationrate laggdpgrowth lagPerChangeDefExp type severity yearsnotax cubicspline1 cubicspline2 cubicspline3 if severity>3, vce(robust)
{txt}
{com}.         keep if e(sample)
{txt}(858 observations deleted)

{com}. 
.         predict base, pr
{txt}
{com}.         
.         tempvar pr_0 pr_1 
{txt}
{com}.         replace party = 0
{txt}(72 real changes made)

{com}.         predict `pr_0', pr
{txt}
{com}. 
.         replace party = 1
{txt}(142 real changes made)

{com}.         predict `pr_1', pr
{txt}
{com}.         gen pe = `pr_1' - `pr_0'
{txt}
{com}. 
.         qui sum pe
{txt}
{com}.         local ape = round(r(mean), 0.001)
{txt}
{com}.         local sdpe = round(r(sd), 0.001)
{txt}
{com}. 
.         di "Average partial effect = " `ape'
{res}Average partial effect = .199
{txt}
{com}.         di "Standard deviation of partial effect = " `sdpe'
{res}Standard deviation of partial effect = .151
{txt}
{com}. 
.         sum base `pr_0' `pr_1' pe

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}base {c |}{res}        142    .1338028    .1930074   .0012483   .8090991
{txt}{space 4}__00001E {c |}{res}        142    .0209912     .029604   .0003064   .1899403
{txt}{space 4}__00001F {c |}{res}        142    .2198374    .1771243   .0055089   .8090991
{txt}{space 10}pe {c |}{res}        142    .1988462    .1507289   .0052025   .6191589
{txt}
{com}.         sum pe, det

                             {txt}pe
{hline 61}
      Percentiles      Smallest
 1%    {res} .0208446       .0052025
{txt} 5%    {res} .0342945       .0208446
{txt}10%    {res} .0424322       .0264535       {txt}Obs         {res}        142
{txt}25%    {res} .0713423       .0274712       {txt}Sum of Wgt. {res}        142

{txt}50%    {res} .1526617                      {txt}Mean          {res} .1988462
                        {txt}Largest       Std. Dev.     {res} .1507289
{txt}75%    {res} .2911663       .5792121
{txt}90%    {res} .4046378       .6057228       {txt}Variance      {res} .0227192
{txt}95%    {res} .5209776       .6188059       {txt}Skewness      {res} .9583268
{txt}99%    {res} .6188059       .6191589       {txt}Kurtosis      {res} 3.225505
{txt}
{com}.         hist pe
{txt}(bin={res}11{txt}, start={res}.0052025{txt}, width={res}.05581422{txt})
{res}{txt}
{com}.         
.         gen pe_fmk = .061
{txt}
{com}.         bys yearsnotax: egen pe_mn = mean(pe)
{txt}
{com}.         keep pe* yearsnotax 
{txt}
{com}.         saveold "Flores-Macias and Kreps 2013\Data\Observed-Case Partial Effects--FMK.dta", replace version(12) 
{txt}{p 0 1 2}
(saving in Stata 12 format, which can be read
by Stata 11 or 12)
{p_end}
file Flores-Macias and Kreps 2013\Data\Observed-Case Partial Effects--FMK.dta saved

{com}. restore
{txt}
{com}. 
. *** They underestimate the true effect by using the average-case approach!
. 
{txt}end of do-file

{com}. log close
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}C:\Users\williamslaro\Documents\Research\Projects\Compression\Fall 2017\Final Version\Replication\Compression--Replication.smcl
  {txt}log type:  {res}smcl
 {txt}closed on:  {res} 6 Mar 2018, 14:07:04
{txt}{.-}
{smcl}
{txt}{sf}{ul off}